Trying to get mysql to init

Ian Blenke 10 years ago
parent
commit
69e6fea736
1 changed files with 7 additions and 6 deletions
  1. 7 6
      docker/scripts/init

+ 7 - 6
docker/scripts/init

@@ -24,8 +24,6 @@ grep = /app/.env.example | sed -e 's/^#\([^ ]\)/\1/' | grep -v -e '^#' | cut -d=
24 24
     eval "echo \"$var=\\\"\${HUGINN_$var:-\$$var}\\\"\""
25 25
   done | grep -v -e ^= > /app/.env
26 26
 
27
-cat /app/.env
28
-
29 27
 chmod ugo+r /app/.env
30 28
 source /app/.env
31 29
 
@@ -62,11 +60,13 @@ EOF
62 60
 # prepare the supervisord bootstrap service script
63 61
 
64 62
 cat <<BOOTSTRAP > /tmp/bootstrap.sh
65
-#!/bin/bash -xe
63
+#!/bin/bash -e
66 64
 source /app/.env
67 65
 
68
-# start mysql server if \${DATABASE_HOST} is localhost
69
-if [ "\${DATABASE_HOST}" = "localhost" ]; then
66
+echo DATABASE_HOST=\${DATABASE_HOST}
67
+
68
+# start mysql server if \${DATABASE_HOST} is the .env.example default
69
+if [ "\${DATABASE_HOST}" = "your-domain-here.com" ]; then
70 70
   if [ "\${DATABASE_ADAPTER}" = "postgres" ]; then
71 71
     echo "DATABASE_ADAPTER 'postgres' is not supported internally. Please provide DATABASE_HOST."
72 72
     exit 1
@@ -107,6 +107,7 @@ EOF
107 107
       echo "Failed to start mysql server"
108 108
       exit 1
109 109
     fi
110
+    echo -n .
110 111
     sleep 1
111 112
   done
112 113
 
@@ -138,7 +139,7 @@ stopwaitsecs=1
138 139
 EOF
139 140
 
140 141
 cat <<FOREMAN > /tmp/foreman.sh
141
-#!/bin/bash -xe
142
+#!/bin/bash -e
142 143
 source /app/.env
143 144
 
144 145
 # Assuming we have a created database, run the migrations and seed it idempotently.